﻿using System;
using System.Linq;
using System.Text;
using Celeriq.Common;

namespace Celeriq.Server.Interfaces
{
    public static class Extensions
    {
        public static void Initialize(this ServerResourceSettings item)
        {
            item.AutoDataUnloadTime = ConfigurationSettings.AutoDataUnloadTime;
            item.MaxMemory = ConfigurationSettings.MaxMemory;
            item.MaxRunningRepositories = ConfigurationSettings.MaxRunningRepositories;
        }

        public static void Save(this ServerResourceSettings item)
        {
            ConfigurationSettings.AutoDataUnloadTime = item.AutoDataUnloadTime;
            ConfigurationSettings.MaxMemory = item.MaxMemory;
            ConfigurationSettings.MaxRunningRepositories = item.MaxRunningRepositories;
            ConfigurationSettings.Save();
        }
    }
}
